Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Update pm details in Psync response #6011

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

prasunna09
Copy link
Contributor

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

pr on oss main - #6003
Currently, in Psync response, payment_method_data is being none. Updated the Psync response with pm data.
For network token pm data will be none, since we are not storing additional pm data in attempt.
For other payment methods, it will continue to function as it did previously.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

payment curl -

    "amount": 6540,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 6540,
    "customer_id": "StripeCustomer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://duck.com/",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "10",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "123"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "sundari"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "routing": {
        "type": "single",
        "data": "stripe"
    }
    
}```
test cases - make a successful payment, pm data should be displayed in the response
PaymentsCreate - 
<img width="702" alt="Screenshot 2024-09-24 at 1 54 01 PM" src="https://github.com/user-attachments/assets/cb4635ef-95c9-4127-aa67-25f1b372efd3">

 PSync - 
<img width="710" alt="Screenshot 2024-09-24 at 1 54 16 PM" src="https://github.com/user-attachments/assets/1fb845e8-da1a-4257-af73-0cdce5171d56">

Save Card flow - 
<img width="763" alt="Screenshot 2024-09-24 at 1 54 30 PM" src="https://github.com/user-attachments/assets/2c2dde1c-f841-47b5-9d76-a4fcd48d5204">



## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed the submitted code
- [ ] I added unit tests for my changes where possible

@prasunna09 prasunna09 added A-core Area: Core flows C-bug Category: Bug labels Sep 24, 2024
@prasunna09 prasunna09 self-assigned this Sep 24, 2024
@prasunna09 prasunna09 requested a review from a team as a code owner September 24, 2024 10:41
Copy link

semanticdiff-com bot commented Sep 24, 2024

Review changes with SemanticDiff.

Analyzed 1 of 1 files.

Overall, the semantic diff is 38% smaller than the GitHub diff.

Filename Status
✔️ crates/router/src/core/payments/transformers.rs 37.22% smaller

@prasunna09 prasunna09 linked an issue Sep 24, 2024 that may be closed by this pull request
2 tasks
@likhinbopanna likhinbopanna merged commit cbeddb3 into hotfix-2024.09.20.0 Sep 24, 2024
13 of 15 checks passed
@likhinbopanna likhinbopanna deleted the fix-pm-sync-resp branch September 24, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [CORE] Payment method details are being none in Psync Response.
4 participants